<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="ko">
<head>
	<%@ include file="/include/header.jsp" %>
	<link rel="stylesheet" href="<%=cp %>/mobile/skin/board/notice/style.css">
	<%@ include file="/include/commonRes.jsp" %>
</head>
<body>
<div id="hd_login_msg">최고관리자 최고관리자님 로그인 중 <a href="http://mkis.fieram.gethompy.com/bbs/logout.php">로그아웃</a></div>

<%@include file="/include/mainMenuHeader.jsp" %>
<div id="wrapper">
	<div id="container">
		<!-- skin : /home/hosting_users/staff12_mkis/www/mobile/skin/board/notice -->
		<section id="bo_w">
		    <h2 id="container_title">공지 사항 글쓰기</h2>
		
		    <form name="fwrite" id="fwrite" action="http://mkis.fieram.gethompy.com/bbs/write_update.php" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
			    <input type="hidden" name="w" value="">
			    <input type="hidden" name="bo_table" value="notice">
			    <input type="hidden" name="wr_id" value="0">
			    <input type="hidden" name="sca" value="">
			    <input type="hidden" name="sfl" value="">
			    <input type="hidden" name="stx" value="">
			    <input type="hidden" name="spt" value="">
			    <input type="hidden" name="sst" value="">
			    <input type="hidden" name="sod" value="">
			    <input type="hidden" name="page" value="">
		        <div class="tbl_frm01 tbl_wrap">
		        <table>
		        	<caption>공지 사항 글쓰기</caption>
		        	<tbody>
		                <tr>
				            <th scope="row"><label for="ca_name">분류<strong class="sound_only">필수</strong></label></th>
				            <td>
				                <select class="required" id="ca_name" name="ca_name" required="">
				                    <option value="">선택하세요</option>
				                    <option value="공고">공고</option>
									<option value="병원관련">병원관련</option>
									<option value="진료관련">진료관련</option>
									<option value="아이디어">아이디어</option>
									<option value="공지">공지</option>
				                </select>
				            </td>
		        		</tr>
		        
				        <tr>
				            <th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
				            <td><input type="text" name="wr_subject" value="" id="wr_subject" required="" class="frm_input required"></td>
				        </tr>
		
				        <tr>
				            <th scope="row"><label for="wr_content">내용<strong class="sound_only">필수</strong></label></th>
				            <td class="wr_content">
		                    	<span class="sound_only">웹에디터 시작</span>
								<textarea id="wr_content" name="wr_content" class="" maxlength="65536" style="width:100%"></textarea>
								<span class="sound_only">웹 에디터 끝</span>                            
							</td>
				        </tr>
		
		                <tr>
				            <th scope="row">파일 #1</th>
				            <td>
				                <input type="file" name="bf_file" title="파일첨부 1 :  2,400 바이트 이하만 업로드 가능" class="frm_file frm_input">
		                    </td>
				        </tr>
		        	</tbody>
		        </table>
		    </div>
		
		    <div class="btn_confirm">
		        <input type="submit" value="작성완료" id="btn_submit" class="btn_submit" accesskey="s">
		        <a href="./board.php?bo_table=notice" class="btn_cancel">취소</a>
		    </div>
		    </form>
		</section>
		
		<script>
			function html_auto_br(obj)
			{
			    if (obj.checked) {
			        result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
			        if (result)
			            obj.value = "html2";
			        else
			            obj.value = "html1";
			    }
			    else
			        obj.value = "";
			}
			
			function fwrite_submit(f)
			{
			    var wr_content_editor = document.getElementById('wr_content');
			    if (!wr_content_editor.value) { alert("내용을 입력해 주십시오."); wr_content_editor.focus(); return false; }
			
			    var subject = "";
			    var content = "";
			    $.ajax({
			        url: g5_bbs_url+"/ajax.filter.php",
			        type: "POST",
			        data: {
			            "subject": f.wr_subject.value,
			            "content": f.wr_content.value
			        },
			        dataType: "json",
			        async: false,
			        cache: false,
			        success: function(data, textStatus) {
			            subject = data.subject;
			            content = data.content;
			        }
			    });
			
			    if (subject) {
			        alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
			        f.wr_subject.focus();
			        return false;
			    }
			
			    if (content) {
			        alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
			        if (typeof(ed_wr_content) != "undefined")
			            ed_wr_content.returnFalse();
			        else
			            f.wr_content.focus();
			        return false;
			    }
			
			    if (document.getElementById("char_count")) {
			        if (char_min > 0 || char_max > 0) {
			            var cnt = parseInt(check_byte("wr_content", "char_count"));
			            if (char_min > 0 && char_min > cnt) {
			                alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
			                return false;
			            }
			            else if (char_max > 0 && char_max < cnt) {
			                alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
			                return false;
			            }
			        }
			    }
			
			    
			    document.getElementById("btn_submit").disabled = "disabled";
			
			    return true;
			}
		</script>
		    
		    
	</div>
	
</div>
<%@ include file="/include/footer.jsp" %>

</body>
</html>